package cn.cxq.learning.e2_2and3;

/**
 * 秦久韶算法
 */
public class HornerScheme {

    public static double polyValue(double x, double[] A, int n) {
        double y;
        int k;
        y = A[n];
        for (k = n - 1; k >= 0; k--) y = y * x + A[k];
        return y;
    }

}
